import request from '@/service/index.js'

export const queryCarouselList = () => {
  return request.get('/carousel/list')
}

export const addNewCarousel = (params) => {
  return request.post('/carousel/add', {
    type: params.type,
    title: params.title,
    carouselImage: params.carouselImage,
    status: params.status,
    sort: params.sort,
    linkValue: params.productId,
  })
}

export const deleteCarousel = (id) => {
  return request.delete(`/carousel/${id}`)
}

export const updateCarousel = (params) => {
  return request.put(`/carousel`, {
    id: params.id,
    type: params.type,
    title: params.title,
    carouselImage: params.carouselImage,
    status: params.status,
    sort: params.sort,
    linkValue: params.productId,
  })
}
